import java.util.ArrayList;
import java.util.List;

public class ART626 {

	private static final int EXPERIMENTS_NUMBER = 10;
	private static final int TEST_LIMIT = 10000;
	private static final String EXECUTED_FOLDER = "experiment";

	public static void main(String[] args) {
		for (int i = 0; i < EXPERIMENTS_NUMBER; i++) {

			boolean ok;

			EventPool eventPool = new EventPool();
			List<TestCase> executedTestCases = new ArrayList<TestCase>();

			TestCase t = new TestCase(eventPool.createCandidate());

			ok = t.execute(EXECUTED_FOLDER);

			executedTestCases.add(t);

			for (int j = 1; j < TEST_LIMIT && ok; j++) {
				int d = 0;

				Candidate[] candidateList = new Candidate[EventPool.CANDIDATE_LIST_SIZE];
				int farthest = 0;

				for (int k = 0; k < EventPool.CANDIDATE_LIST_SIZE; ++k) {
					candidateList[k] = eventPool.createCandidate();
					int di = candidateList[k]
							.smallestDistance(executedTestCases);

					if (di > d) {
						d = di;
						farthest = k;
					}
				}
				t = new TestCase(candidateList[farthest]);

				executedTestCases.add(t);
				ok = t.execute(EXECUTED_FOLDER);
			}
		}
	}
}